package com.etc.iodemo;


import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

/**
 * @author: knowno
 * @create: 2024-09-11 17:02
 * @Version 1.0
 **/
public class TestBufferedReader {
    public static void main(String[] args) throws IOException {

        String filepath = "d:\\demo\\demo.txt";

        //1 FileReader对象的创建
        FileReader fileReader = new FileReader(filepath);
        //
        BufferedReader bufferedReader = new BufferedReader(fileReader);


        //2 调用方法 :
        String str = "";
        while((str = bufferedReader.readLine())!=null){
            //输出
            System.out.println(str);
        }

        //3 关闭
        fileReader.close();

    }
}
